package com.grf.hadoop.temp_grouping;

import org.apache.hadoop.io.DoubleWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

public class TempReducer extends Reducer<TempBean , NullWritable, TempBean, NullWritable> {

    private TempBean k = new TempBean();

    @Override
    protected void reduce(TempBean key, Iterable<NullWritable> values, Context context)
            throws IOException, InterruptedException {
        int i = 0;
        for (NullWritable value : values) {
            if (i==3) {
                break;
            }
            context.write(key, value);
            i++;
        }

    }
}
